#!/bin/sh
TMPDIR=/usr/local/src/OpenRTM
RTMVER=-1.0.0
RTMSRCPDIR=$TMPDIR/OpenRTM-aist$RTMVER
          
ROS_PATCH=ros_transport_diamondback.patch
ROS_PATCH_FILE=$RTMEUSDIR/tools/$ROS_PATCH

if [ ! -e ${TMPDIR} ];
then
    ./setup-official_all.sh 
fi

cp $ROS_PATCH_FILE $RTMSRCPDIR
cd $RTMSRCPDIR
patch -p0 < $ROS_PATCH
# distclean & configure
sudo make distclean
sudo apt-get install autoconf libtool
sh build/autogen
./configure --prefix=/usr/local
sudo make ROS_ROOT=$ROS_ROOT ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH
sudo make install
